package com.example.faqdemo.mapper;

import com.example.faqdemo.entity.FAQ;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface FAQMapper extends JpaRepository<FAQ, Integer> {
    @Query("SELECT f FROM FAQ f WHERE f.question LIKE %?1% OR f.answer LIKE %?1%")
    List<FAQ> findByQuestionContainingOrAnswerContaining(String keyword);
}
